﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;

namespace RM.Entities.Data.Map
{
    public class QuestionMap : ClassMap<Question>
    {
        public QuestionMap()
        {
            Id(x => x.Id).Not.Nullable();
            Map(x => x.Name).Length(50).Not.Nullable();
            Map(x => x.Language).Length(50).Not.Nullable();
            Map(x => x.Technology).Length(50).Not.Nullable();
            Map(x => x.Experience);
            Map(x => x.CreatedDate).Not.Nullable();
            Map(x => x.ModifiedDate).Not.Nullable();
            References(x => x.CreatedBy);
            References(x => x.ModifiedBy);
            HasMany(x => x.QuestionList).Cascade.All().Not.LazyLoad();
            //HasMany(x => x.TestList).Cascade.All().Not.LazyLoad();
        }
    }
}
